import React from 'react'
import {Button} from 'antd'
import { useTranslation } from 'react-i18next';
import '../../App.css'
function Index() {
  const { t, i18n } = useTranslation();
  const qh=()=>{
    document.body.classList.toggle('dark')
  }
  const yy = () => {
    i18n.changeLanguage(i18n.language === "en" ? "zh" : "en")
  }
  return (
    <div>
      <Button onClick={qh}>切换主题</Button>
       <h1>{t('mycake')}</h1>
       <Button onClick={yy}>语言切换</Button>
    </div>
  )
}

export default Index
